package com.krain.ddbb.activity;

import android.content.Intent;

import com.krain.ddbb.R;
import com.krain.ddbb.base.BaseActivity;
import com.krain.ddbb.service.LocationService_;

import org.androidannotations.annotations.AfterViews;
import org.androidannotations.annotations.Click;
import org.androidannotations.annotations.EActivity;

@EActivity(R.layout.activity_main)
public class MainActivity extends BaseActivity {



    @Click(R.id.slider)
    void bgClick(){
        BrowserActivity.jumpToThisActivity(mContext,"http://www.boga.cc");
    }
    @AfterViews
    void afterView() {
        startService(new Intent(this, LocationService_.class));
    }


    @Override
    protected void onResume() {
        super.onResume();
        if (app.getmUserinfo().getUid() > 0)
            app.setJpushTags(app.getmUserinfo());
    }

    @Click(R.id.act_main_tv_earn)
    void clickToHelp() {
        if (!app.isLogin()) {
            LoginActivity.jumpTothisActivity(this);
        } else {
            RobOrderListActivity.jumpTothisActivity(this);
        }
    }


    @Click(R.id.act_main_tv_help)
    void clickToEarn() {
        if (!app.isLogin()) {
            LoginActivity.jumpTothisActivity(this);
        } else {
            PlaceOrderActivity.jumpTothisActivity(this);
        }

    }


    @Click(R.id.act_main_rl_center)
    void clickToUserCenter() {
        if (!app.isLogin()) {
            LoginActivity.jumpTothisActivity(this);
        } else {
            UserCenterActivity.jumpTothisActivity(this);
        }
    }

    @Override
    protected String getToolbarTitle() {
        return getString(R.string.title_main);
    }


}
